package com.mxchen.lottery.client.activity.dto;

import com.alibaba.cola.dto.DTO;
import com.mxchen.lottery.client.common.Constants;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author : hmxchen
 * @program : lottery-964-mxchen
 * @description :
 * @create : 2021-12-16 10:30
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DrawDTO extends DTO {
    /**
     * 用户id
     */
    private String uid;
    /**
     * 策略ID
     */
    private Long strategyId;
    /**
     * 奖品ID
     */
    private String rewardId;
    /**
     * 中奖状态：0未中奖、1已中奖、2兜底奖 Constants.DrawState
     */
    private Integer drawState;
    /**
     * 奖品名称
     */
    private String awardName;


    public static DrawDTO create(){
        return new DrawDTO();
    }
    public static DrawDTO create(String uid, Long strategyId, String rewardId,Constants.DrawState drawState,String awardNam){
        return new DrawDTO(uid,strategyId,rewardId,drawState.getCode(),awardNam);
    }
    public static DrawDTO createFail(String uid, Long strategyId){
        return DrawDTO.create(uid,strategyId,null, Constants.DrawState.FAIL,null);
    }
    public static DrawDTO createSuccess(String uid, Long strategyId, String rewardId, String awardName){
        return DrawDTO.create(uid,strategyId, rewardId,Constants.DrawState.SUCCESS, awardName);
    }

}
